<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<!-- content -->
<!-- 分页显示演示开始 -->
<form id="listForm" class="well form-search" action="${ctx}/security/users/list" method="get">
	<input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}" />
	<input type="hidden" name="fieldName" id="fieldName" value="${pageData.compositor.fieldName}" />
	<input type="hidden" name="compositorType" id="compositorType" value="${pageData.compositor.compositorType}" />
	<table class="table table-striped table-bordered table-condensed">
		<tr>
			<th>
				账号:
				<y:search fieldType="S" fieldList="account" matchType="LIKE" className="input-medium search-query" />
				<button class="btn btn-small" onclick="search()" type="button">
					<i class="icon-search"></i>
					搜索
				</button>
				<a href="${ctx}/security/users/new" class="btn btn-small right">添加用户</a>
			</th>
		</tr>
	</table>
</form>
<table class="table table-striped table-bordered table-condensed">
	<thead>
		<tr>
			<th>#</th>
			<th>
				<a href="javascript:sort('account')">账号</a>
			</th>
			<th>
				<a href="javascript:sort('name')">姓名</a>
			</th>
			<th>
				<a href="javascript:sort('department')">所属部门</a>
			</th>
			<th>
				<a href="javascript:sort('phone')">电话</a>
			</th>
			<th>
				<a href="javascript:sort('email')">邮箱E-mail</a>
			</th>
			<th>
				<a href="javascript:sort('enable')">是否禁用</a>
			</th>
			<th>
				<a href="javascript:sort('roles')">角色权限</a>
			</th>
			<th>插入时间</th>
			<th>更新时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="entity" items="${pageData.result}" varStatus="index">
			<tr <c:if test="${!entity.visible}">bgcolor="#AFEEEE"</c:if>>
				<td>${index.index + 1}</td>
				<td>${entity.account}</td>
				<td>${entity.name}</td>
				<td>${entity.department.name}</td>
				<td>${entity.phone}</td>
				<td>${entity.email}</td>
				<td>${entity.enable?'否':'是'}</td>
				<td>
					|
					<c:forEach var="roles" items="${entity.roles}">
					                        ${roles.name }|
					</c:forEach>
				</td>
				<td>${entity.insertTime}</td>
				<td>${entity.lastUpdateTime}</td>
				<td>
					<a href="${ctx}/security/users/edit/${entity.id}">修改</a>
					|
					<a href="${ctx}/security/users/delete/${entity.id}" confirm="删除后无法恢复,确定要删除吗?">刪除</a>
				</td>
			</tr>
		</c:forEach>
	</tbody>
</table>
<%@ include file="/WEB-INF/jsp/commons/pager.jsp"%>
